<?php 
        if (!current_user_can('manage_options'))
		{
			wp_die('You do not have sufficient permissions to access this page.');
		}
        $fb_page = get_option('fb_page');
        $gg_plus = get_option('gg_plus');
        $twitter = get_option('twitter');
        ?>
        <div class="wrap">  
        <?php screen_icon('themes'); ?> <h2>Social settings</h2>
        <form method="POST" action="">  
            <table class="form-table">  
                <tr>
                    <th>
                        <label>Facebook page URL</label>
                    </th>
                    <td>
                        <input value="<?php echo ($_POST['fb_page']?$_POST['fb_page']:$fb_page); ?>" name="fb_page" type="text" placeholder="ex: https://www.facebook.com/pages/Bigsavecouponcom/513148098775933" style="width: 500px;"/>
                    </td>
                </tr>
                <tr>
                    <th>
                        <label>Google plus page URL</label>
                    </th>
                    <td>
                        <input value="<?php echo ($_POST['gg_plus']?$_POST['gg_plus']:$gg_plus); ?>" name="gg_plus" type="text" placeholder="ex: https://plus.google.com/b/102902872586276668699/102902872586276668699/posts" style="width: 500px;"/>
                    </td>
                </tr>
                <tr>
                    <th>
                        <label>Twitter URL</label>
                    </th>
                    <td>
                        <input value="<?php echo ($_POST['twitter']?$_POST['twitter']:$twitter); ?>" name="twitter" type="text" placeholder="ex: https://twitter.com/bigsavecoupon" style="width: 500px;"/>
                    </td>
                </tr>
            </table>
            <p>  
                <input type="submit" value="Save settings" class="button-primary"/>
            </p>   
        </form>  
        </div> 
        <?php  
        if(
        isset($_POST["fb_page"]) || 
        isset($_POST["gg_plus"]) ||
        isset($_POST["twitter"])
        )
        {
            //update facebook page url
            $new_fb_page = esc_attr($_POST["fb_page"]);
            update_option('fb_page',$new_fb_page);
            $new_gg_plus = esc_attr($_POST["gg_plus"]);
            update_option('gg_plus',$new_gg_plus);
            $new_twitter = esc_attr($_POST["twitter"]);
            update_option('twitter',$new_twitter);
            // print success message
            echo '<div id="message" class="updated">Settings saved</div>';
        }
        ?>